﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using S4Store.Domain;
using S4Store.Domain.TelSellerKpi;

namespace S4Store.Models.TelSellerKpi
{
    public class InputSellerKpiDayDataModel
    {
        public List<Employee> Sellers { get; set; }
        public List<CarBrand> CarBrands { get; set; }
        public List<TelSellerKpiDayData> DayDatas { get; set; }
        public DateTime Date { get; set; }

        public TelSellerKpiDayData GetDayData(int sellerid, int carbrandid)
        {
            var data = DayDatas.FirstOrDefault(t => t.SellerId == sellerid && t.CarBrandId == carbrandid);
            if(data==null)
            {
                data = new TelSellerKpiDayData();
                data.Date = Date;
            }
            return data;
        }

        public bool IsConfirmed { get; set; }
    }
}